Repository navigation
fix(objectql): a package-less action customizes a package's action only on its owner key - #33708
Conversation
…owner key Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 991f0dcb38e3c2ae8aa11a26e08b3374e1ba50d3 && git checkout 991f0dcb38e3c2ae8aa11a26e08b3374e1ba50d3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0 cee768517a17627f30bb3b63145bb271a5238a55 && git checkout -B drift-repro 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0 && git merge --no-ff cee768517a17627f30bb3b63145bb271a5238a55
node scripts/docs-audit/affected-docs.mjs --json 6ff3eee7ca595cf1bb5c47e9fc09bb127c0a57d0
|
|
security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (the maintainer routes contract-tier reviews to the review seat, 2026-11-15T07:02Z) · head cee7685 A no-card security#1 order. The reviewer reads the advisories through the relay as the order names them. Seat notes:
Generated by Claude Code |
|
review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB Contract-review-claim: session_01FEkQ5nhu4dRbKVQKDB4CDB · head cee7685 · 2026-11-15T07:03Z |
|
review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB Contract reviewServed-tier: ① Derived judgments
② Semver levelClause-②: no — right. Nothing in the published contract surface widens or is exposed; the diff pulls the registry's binding back to the identity ADR-0150 D4 already declares. ③ Boundary flags
④ Design judgment
Findings:
No must-fix and no should-fix. The round ends here. Implemented-by: VERDICT: PASS |
|
security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f 席位核对ACCEPT at
Implemented-by: os-dev (security#1 order, Generated by Claude Code |
Clause-②: no
Metadata-protocol: none
维护者速读
action类型的一处绑定判断,其它元数据类型照旧(有对照测试);回滚即 revert 本 PR。packages/objectql/src/registry.ts(overlaySlotBinding无包分支与新函数actionHoldersOnOwnerKeyOf)、packages/objectql/src/action-package-addressing.test.ts、packages/runtime/src/action-package-addressing.test.ts。pnpm --filter @objectstack/objectql exec vitest run src/action-package-addressing.test.ts,预期 28 个测试全绿。What changes
Rule: executing an action resolves the action its own package declared on its owner key, never a same-named action of another object or package, and the permission and parameter checks run on that resolved declaration.
An action is identified by
(package, owning object, name)(ADR-0150 D4). The registry's package-scoped reads (getPackageScopedItem,getEnvironmentScopedItem, and through themresolveActionByPackage) now apply that identity to a package-less action:packages/objectql/src/registry.ts:overlaySlotBindingcounts, foraction, only the holders whose own item has the package-less action's owner key (actionHoldersOnOwnerKeyOf, keyed bystandaloneActionOwnerKey, every object-less spelling one key). Every other type keeps the one-holder reading.Effect at the route: a caller of a package, or of a package depending on it, resolves that package's own declaration on its object under that package's coordinate; a package caller on the object of a package-less action is refused naming the environment (ADR-0150 D3), never answered as another package's. A route that names no package answers as before.
Not changed here: the exact
?package=read and the declaration read of a route that names no package. Both already answer each route's own declaration in every composition these pins exercise (the controls below).Tests
packages/objectql/src/action-package-addressing.test.ts, new top-level describe "a package-less action customizes only the holder whose action has its owner key": 8 cases (6 pins, 2 controls): one holder on another object in both registration orders, the holder's caller and its dependent's caller, the package-less action's own object for a caller with no package and for a package caller, object-less beside bound, two holders on two objects (third object, and one holder's object), a bound holder beside an object-less one. Controls: the one holder's own owner key (bound and object-less), two holders on one owner key, and another type (mapping) keeping the one-holder reading.packages/runtime/src/action-package-addressing.test.ts, new top-level describe "the action route resolves the declaration its own package declared on its owner key": the environment's and the platform's package-less action, each in both registration orders, throughresolveRouteActionDeclarationandexecuteRegisteredAction: 8 pins, 5 controls (the no-package route on both objects keeps each declaration and itsrequiredPermissions; a package-less action on the package's own object stays its customization).Acceptance notes
scripts/ablation-replace.mjs(anchor 1 to 0, blob changed),@objectstack/objectqlrebuilt, the marker absent fromdist/(0 hits inindex.jsandindex.mjs). Red: objectql 6 failed / 22 passed (28), every pin red, every control green; runtime 8 failed / 5 passed (13 selected), every pin red, every control green. Restored: blob equal to HEAD (8728bd488ed3),git diff HEADempty, rebuilt,ablation-dist-preflightmarker present in 4 built files; objectql 28/28, runtime 136/136. The mutant build's DTS step failed on the then-unused helper (TS6133) after the JS bundles were written; the JS bundles carried the mutant, which is what the runtime suite loads.packages/objectql/src/registry.tsin the object-extension follow area; no hunk shared with this diff.Verification
All readings on head
cee768517aunless named.Package suites
Derived gate families (dispatch-gates --commands, reconciled with --ran)
Generated by Claude Code